﻿using MediatR;
using RBAC.LuFang.API.Application.Command.EnterpriseCommand;
using RBAC.LuFang.Domain.Traceability;
using RBAC.LuFang.Domin.Services.TraceabilityService;

namespace RBAC.LuFang.API.Application.CommandHandlers.EnterpriseHandler
{
    //显示养殖下的企业信息
    public class EnterpriseSelectCommandHandler:IRequestHandler<EnterpriseSelectCommand, List<Enterprise>>
    {
        private readonly IGoodsService _goodsService;

        public EnterpriseSelectCommandHandler(IGoodsService goodsService)
        {
            _goodsService = goodsService;
        }

        public async Task<List<Enterprise>> Handle(EnterpriseSelectCommand request, CancellationToken cancellationToken)
        {
            return await _goodsService.GetEnter(request.goodsid);
        }
    }
}
